import DGDialogLayout from "../../../components/DGDialogLayout/DGDialogLayout.tsx";
import DGDrawerLayout from "../../../components/DGDrawerLayout/DGDrawerLayout.tsx";
import {useNavigate} from "react-router-dom";
import {FC} from "react";
import DGTextView from "../../../components/DGTextView.tsx";

interface DGForgetResultProps {
    state: boolean,
    switchView: (text: string) => void
}

const DGForgetResult: FC<DGForgetResultProps> = ({state, switchView}) => {
    // 路由跳转
    const router = useNavigate();
    // 面板控制
    const handleClose = () => {
        // 关闭面板
        switchView("");
        // 后退路由
        router(-1);
    }
    return (<>
        {/* DGDialogLayout 样式 */}
        <DGDialogLayout
            submit={{name: "登录", click: () => switchView("login_index")}}
            title="找回密码" state={state} close={() => handleClose()} PANEL AUTO>
            {/* 提示语 */}
            <DGTextView Body Bold>您的密码已重置成功，现在您可以前往登陆账户享受更多资源。</DGTextView>
        </DGDialogLayout>
        {/* DGDrawerLayout 样式 */}
        <DGDrawerLayout
            submit={{name: "登录", click: () => switchView("login_index")}}
            title="找回密码" state={state} close={() => handleClose()} flex="bottom" PANEL AUTO>
            {/* 提示语 */}
            <DGTextView Body Bold>您的密码已重置成功，现在您可以前往登陆账户享受更多资源。</DGTextView>
        </DGDrawerLayout>
    </>);
}
export default DGForgetResult;